<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
         trimDirectiveWhitespaces="true"%>
<%@ page import="com.myfoon.action.backing.system.CountryBean, com.myfoon.model.entity.CountryName"%>
<%@ page import="javax.ejb.EJB"%>
<%@ page import="com.myfoon.model.cacheable.EventCache,                 
                 com.myfoon.model.cacheable.UserCache,
                 com.myfoon.action.backing.system.UserBean,
                 com.myfoon.helper.SessionHelper,
                 java.util.Map,
                 java.util.Iterator,
                 com.myfoon.model.entity.User"%>
<%@ page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%              
    Cookie cookies[] =  request.getCookies();
    
    String fu_tz = "0";       
    SessionHelper sessionHelper = new SessionHelper(request);
    Integer tzOffset = sessionHelper.getTimeZoneOffset();        
    
    String st = request.getParameter("st");
    int start = st == null ? 0 : Integer.valueOf(st);
    UserBean userBean = new UserBean();
    User user = (User)session.getAttribute("user");
    
    Object friends[] = userBean.findPagedFriends(user, start);
    Integer totalCount = (Integer)friends[0];
    List<UserCache> friendList = (List<UserCache>)friends[1];
    
    request.setAttribute("start", start);
    request.setAttribute("totalCount", totalCount);
    request.setAttribute("friends", friendList);        
%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="/css/global.css"/>
    <link rel="stylesheet" type="text/css" href="/css/home.css"/>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/curve.js"></script>
    <script type="text/javascript" src="/js/json2.js"></script>
    <script type="text/javascript" src="/js/home3.js"></script>
    <script type="text/javascript">           
      $(function() {                        
          $('.toolbox').cornerz({radius: 4, background: "white"})          
          $('#side').cornerz({radius: 6, background: "white"})                              
          $('.searchbox').cornerz({radius: 4, background: "white", corners: "bl br"})
          $('.r2side').cornerz({radius: 4, background: "white"})
          $('.r2advertisement').cornerz({radius: 4, background: "white"})
        })      
    </script>
    <title>Friends</title>    
  </head>
  <body>
    <div id="content">
      <div id="top">                
        <div id="top_menu">
            <span><a href="/home.jsp">Home</a></span>
            <span class="separator">|</span>
            <span><a href="/profile.jsp">Profile</a></span>
            <span class="separator">|</span>
            <span><a href="/friends.jsp">Friends</a></span>                        
            <span class="separator">|</span>            
            <span><a href="/friends.jsp">My Wiki</a></span>                        
            <span class="separator">|</span>            
            <span><a href="/communities.jsp" class="menulink">My Communities</a></span>
        </div>
        <div class="top_menu_right">
            <select class="mf_input mf_lang">
                <option value="1">English</option>
            </select>
        </div>
        <div class="top_menu_right">            
            <span><a href="/settings.jsp">Settings</a></span>
            <span class="separator">|</span>
            <span><a href="/help.jsp">Help</a></span>
            <span class="separator">|</span>
            <span><a href="/logout.jsp">Logout</a></span>                                                    
        </div>        
      </div>                   
      <div id="main">
        <div id="side">
          <div id="p_img">
            <img src="/images/onur.jpg" width="120" height="108" border="0"/>
          </div>
          
          <div class="menubox">
              <ul>
                <li><%= user.getUserPi().getFullname() %></li>
              </ul>
          </div>
          <div class="toolbox2">
            <ul>
                  <li>All</li>
                  <li>Follow List</li>
                  <li>Favorites</li>
                  <li>Where friends are</li>
                  <li>Only Photos</li>
                  <li>Only Videos</li>
            </ul>        
          </div>
           
          <div class="menubox">
            <h4>Applications</h4>             
            <ul>
               <li>                    
                    <img src="http://b.static.ak.fbcdn.net/images/icons/gift.gif?8:32236" 
                    height="16" width="15" border="0" style="vertical-align:middle;">
                    </img>
                    <a href="abc">Gifts</a>
               </li>                                 
               <li>                    
                    <img src="http://photos-d.ak.fbcdn.net/photos-ak-sf2p/v43/79/4771353211/app_2_4771353211_2396.gif" 
                    height="16" width="16" border="0" style="vertical-align:middle;">
                    </img>
                    <a href="abc">Speed Date</a>
               </li>            
               <li>                    
                    <img src="http://photos-f.ak.fbcdn.net/photos-ak-sf2p/v43/33/41467512021/app_2_41467512021_5386.gif" 
                    height="16" width="16" border="0" style="vertical-align:middle;">
                    </img>
                    <a href="abc">Seçim Anketi</a>
               </li>                                      
            </ul>
          </div>
        </div>         
        <div id="right">
          <div id="r1">                         
            <div id="recentpostsbox" class="rd">              
              <div style="border-bottom: Solid 1px #E9E9E9; padding: 3px; text-align: center;">
                <span style="font-size: 11px;">
                    <c:out value="Showing "/>                
                    <b><c:out value="${start+1} - ${start + fn:length(friends)} "/></b>                
                    <c:out value="of" />
                    <b><c:out value="${totalCount}"/></b>
                </span>                     
                <span style="font-size: 11px; ">
                    first  |  < previous  |  next>  |  last
                </span>                
              </div>
              
               <div id="recentposts">
              <table width="100%" cellpadding="5" cellspacing="0" border="0"
                     class="rp">
                <c:forEach var="friend" items="${friends}">
                  <tr>
                    <td width="50px">
                      <img src="${ friend.photoSmall }" width="50px" height="50px"/>
                    </td>
                    <td>                      
                        <c:url var="url" value="/profile.jsp">
                          <c:param name="id" value="${friend.id}"/>
                        </c:url>                        
                        <a href="${url}" class="profile_link"><c:out value="${friend.fullname}"/></a>                        
                    </td>
                    <td class="tools" valign="top" width="80px">
                        <ul>
                        <li><a class="tools_link" href="javascript: void(0);">Favorite!</a></li>                        
                        <li><a class="tools_link" href="javascript: void(0);">Remove</a></li>
                        </ul>
                    </td>
                  </tr>
                </c:forEach>
              </table>
              </div>
            </div>
          </div>
           
          <div id="r2">
            <div class="searchbox">
                <input type="text" class="mf_input mf_search"/>
                <a class="search_button" href="javascript: void(0);" onclick="alert('search');"></a>     
                <div style="clear: both;"></div>
            </div>                    
            <div class="r2side">
                <h4>Upcoming Events</h4>
            </div>
            
            <div class="r2side">
                <h4>Advertisement</h4>
                <div class="r2sidebox_first">
                    <p><a href="http://www.Eshopping-Europe.info" class="title">85% Off Luxury handbags</a></p>
                    <span class="content">Top-quality Fashion brand Bags
                        Native Warrantor for 100% shipping
                    </span>
                    <p><a target="_blank" href="http://www.Eshopping-Europe.info">www.Eshopping-Europe.info</a></p>
                </div>
                <div class="r2sidebox">
                    <p><a href="http://www.kaanair.com" class="title">Agusta Helicopters Turkey</a></p>               
                    <span class="content">
                        Kaan Air the exclusive distributor
                        of AgustaWestland
                    </span>
                    <a target="_blank" href="http://www.kaanair.com">www.kaanair.com</a>
                </div>                
                <div class="r2sidebox">
                    <p><a href="http://www.GittiGidiyor.com/Sifir_Risk" class="title">Shoe stores?</a></p>         
                    <span class="content">
                        Aradığınız Herşey Burada!
                        Sıfır Risk Sistemi ile Güvenle Alın
                    </span>
                    <a target="_blank" href="http://www.GittiGidiyor.com/Sifir_Risk">www.GittiGidiyor.com/Sifir_Risk</a>
                </div>       
            </div>
          </div>
        </div>
      </div>       
      <div id="bottom">
        <div class="bottom2">
        <ul class="about">
            <li class="first"><fmt:message key="global.myfoon"/></li>
            <li><a href="/advertise"><fmt:message key="global.advertise"/></a></li>
            <li><a href="/advertise">Developers</a></li>
            <li><a href="/advertise">Careers</a></li>
            <li><a href="/advertise">Privacy Policy</a></li>
            <li><a href="/advertise">Terms of Service</a></li>
            <li><a href="/advertise">Send Feedback</a></li>
            <li><a href="/advertise"><fmt:message key="global.help"/></a></li>    
        </ul>
        </div>
      </div>
    </div>
  </body>
</html>